package com.gopay.bis.manager.bank.tolly.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.gopay.bis.dao.tolly.BisQueryValidatorDAO;
import com.gopay.bis.manager.bank.tolly.BisQueryValidatorManager;
import com.gopay.common.domain.bank.outside.gboss.resp.query.validator.EduInfo;
import com.gopay.common.util.DateUtils;

/**
 * 学历认证manager
 * @BisQueryValidatorManagerImpl.java
 * @author lilili
 * @2016年6月13日 下午5:33:40  www.gopay.com.cn Inc.All rights reserved.
 */
@Service("bisQueryValidatorManager")
public class BisQueryValidatorManagerImpl implements BisQueryValidatorManager {

	@Resource(name = "bisQueryValidatorDAO")
	private BisQueryValidatorDAO bisQueryValidatorDAO;

	/**
	 * 根据姓名，证件号查询
	 * @param name
	 * @param certifyCode
	 * @return eduInfo
	 */
	@Override
	public EduInfo getEduInfo(String name, String identityCode) {
		 return this.bisQueryValidatorDAO.getBisQueryValidator(name, identityCode);
	}

	/**
	 * 新增数据
	 * @param eduInfo
	 */
	@Override
	@Transactional(propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
	public void insertEduInfo(EduInfo eduInfo) {
		/**
		 * 设置当前时间
		 */
		Date currDate = DateUtils.getSystemDate();
		eduInfo.setCreatedTs(currDate);
		eduInfo.setLastUpdTs(currDate);
		bisQueryValidatorDAO.insertBisQueryValidator(eduInfo);
	}

}
